import request from '@/utils/request'

const basePath = '/jpower-system'

/**
 * @description: 数据列表
 * @param {*} params
 * @return {*}
 */
export function getList(params) {
  return request({
    url: basePath + '/core/org/listLazyByParent',
    method: 'get',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}

export function getOrgTree(params) {
  return request({
    url: basePath + '/core/org/tree',
    method: 'get',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}

export function createOrg(params) {
  return request({
    url: basePath + '/core/org/add',
    method: 'post',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}

export function editorOrg(params) {
  return request({
    url: basePath + '/core/org/update',
    method: 'put',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params
  })
}

export function removeItem(ids) {
  return request({
    url: basePath + '/core/org/deleteStatus',
    method: 'delete',
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    },
    params: { ids }
  })
}
